#include <iostream>
#include <cstdio>
#define MAXN 233333
using namespace std;

struct node {
    int l,r,mi;
}nd[MAXN*3];

int n, q, a[MAXN];

int read() {
    int k = 0;
    char c = getchar();
    for (; ! isdigit(c); c = getchar());
    for (; isdigit(c); c = getchar()) k = k * 10 + c - '0';
    return k;
}

void build(int i, int l, int r) {
    nd[i].l = l;
    nd[i].r = r;
     
    if (l == r) {
	nd[i].mi = a[l];
	return;
    }

    else {
	int mid = (l + r) / 2;
	build (i * 2, l, mid);
	build (i * 2 + 1, mid + 1, r); 
    }
    
    nd[i].mi = min(nd[i * 2].mi ,nd[i * 2 + 1].mi);
}

void change (int i){
    nd[i].mi = min(nd[i*2].mi ,nd[i * 2 + 1].mi);
    if (i == 1)return;
    else change(i / 2);
}

int find(int i, int l, int r){
    if(nd[i].l == l && nd[i].r == r){
		return nd[i].mi;
    }
    else {
		if (nd[i * 2].l <= l && nd[i * 2].r >= r)
		    return find(i * 2, l, r);
		else if (nd[i * 2 + 1].l <= l && nd[i * 2 + 1].r >= r)
		    return find(i * 2 + 1,l ,r);
		else{
			int a=find(i * 2 ,l ,nd[i*2].r);
			int b=find(i * 2 + 1 ,nd[i*2+1].l,r);
			return min(a, b);
			
		}
    }
}

void solve(bool c) {
    if (c) {
        int k = read();
        int nu = read();
        a[k] = nu;
//		cout<< 1;
        change (k / 2);
    }
    else {
		int le=read();
		int ri=read();
		printf("%d\n", find(1, le, ri));
    }

}

int main (){
    n = read();

    for (int i = 1; i <= n; i++) {
	a[i] = read();
    }
    
    build(1, 1, n);

    q=read();

    while (q--) {
		bool check = read();
		solve(check);
    }
    return 0;
}
